import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStream;
import java.util.Scanner;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: wx
 * Date: 2024-03-11
 * Time: 21:34
 */

//Scanner
// 也可以使用 Scanner 帮助我们来进行读取文件
// Scanner(System.in) 本质上也是一个 InputStream/

public class IODemo12 {
    //和以前从读取键盘收入就相当于等同了,风格一致.
    public static void main(String[] args) {
        try(InputStream inputStream = new FileInputStream("aaa/test,txt")){
            Scanner scanner = new Scanner(inputStream);
            while(scanner.hasNext()){
               String s = scanner.next();
                System.out.println(s);

            }
        } catch (IOException e) {
            throw new RuntimeException(e);
        }
    }
}
